<template>
	<view class="container">
		<view class="hzimg">
			<image src="/static/hjzx.jpg"></image>
			<view class="hzText">
				{{ app.language.userTj }}
			</view>
		</view>
		<view class="listBox"></view>
	</view>
</template>

<script>
	import {GetHotelInfo} from '@/api/form.js'
	const global = getApp().globalData;
	export default {
		data() {
			return {
				app: {
					global: global,
					name: global.appName,
					language: global.language
				},
				tzid:"",
				token:""
			}
		},
		onLoad(options) {
			this.tzid = options.id
			this.getToken()
		},
		methods: {
			// 获取token
			getToken() {
				let that = this
				uni.getStorage({
					key: 'loginData',
					success: function(res) {
						let token = res.data.userInfo.appToken
						that.token = res.data.userInfo.appToken
						if (!token) {
							uni.navigateTo({
								url: '../login/login',
							});
						}else{
							that.getList()
						}
					}
				});
			},
			
			// 查询数据
			getList(){
				// 旅店业
				if(this.tzid==1){
					let data = {
						appToken:this.token
					}
					GetHotelInfo(data).then((res) => {
						console.log('旅店业登记',res)
					})
					return
				}
				// 出租房屋报备
				if(this.tzid==2){
					console.log('this.tzid',2)
					return
				}
				// 娱乐场所登记
				if(this.tzid==3){
					console.log('this.tzid',3)
					return
				}
			}
		}
	}
</script>

<style>
	.hzimg image {
		width: 100%;
		height: 222rpx;
	}
	
	.hzText {
		position: absolute;
		top: 70rpx;
		left: 137rpx;
		font-size: 44rpx;
		color: #2f8ef9;
	}
	
	.listBox{
		padding: 10rpx 20rpx;
	}
</style>